Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ethersproject/logger

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ethersproject/logger

Logger utility functions for ethers.

  • 5.7.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
865K
decreased by-9.24%
Maintainers
1
Weekly downloads
 
Created

What is @ethersproject/logger?

@ethersproject/logger is a logging utility designed for use with the ethers.js library. It provides a simple and consistent way to log messages, warnings, and errors, making it easier to debug and track issues in your Ethereum-related applications.

What are @ethersproject/logger's main functionalities?

Logging Messages

This feature allows you to log informational messages. The logger instance is created with a context name ('my-app' in this case), which helps in identifying the source of the log messages.

const { Logger } = require('@ethersproject/logger');
const logger = new Logger('my-app');
logger.info('This is an info message');

Logging Warnings

This feature allows you to log warning messages. Warnings are useful for indicating potential issues that are not necessarily errors but should be looked into.

const { Logger } = require('@ethersproject/logger');
const logger = new Logger('my-app');
logger.warn('This is a warning message');

Logging Errors

This feature allows you to log error messages. Errors indicate serious issues that need immediate attention.

const { Logger } = require('@ethersproject/logger');
const logger = new Logger('my-app');
logger.error('This is an error message');

Custom Error Codes

This feature allows you to create and throw custom errors with specific error codes. This is useful for categorizing and handling different types of errors in a more granular way.

const { Logger } = require('@ethersproject/logger');
const logger = new Logger('my-app');
const error = logger.makeError('Custom error message', 'CUSTOM_ERROR_CODE');
logger.throwError('This is a custom error', 'CUSTOM_ERROR_CODE', { additional: 'info' });

Other packages similar to @ethersproject/logger

Keywords

FAQs

Package last updated on 19 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc